//
//  AXTopCollectionViewCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/10/11.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import "AXTopCollectionViewCell.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"

@interface AXTopCollectionViewCell ()
@property (nonatomic ,strong) UIView *topLine;
@property (nonatomic ,strong) UIView *bottomLine;

@end

@implementation AXTopCollectionViewCell

- (id)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    
    /** numberLabel */
    self.numLabel = [[UILabel alloc]init];
    self.numLabel.textAlignment = NSTextAlignmentCenter;
    self.numLabel.font = FONT_FOURTEEN;;
    [self.contentView addSubview:self.numLabel];
    /** 线*/
    self.topLine = [[UIView alloc]init];
    self.topLine.backgroundColor = [UIColor colorWithHex:0xe2e2e2];
    [self.contentView addSubview:self.topLine];
    
    self.bottomLine = [[UIView alloc]init];
    self.bottomLine.backgroundColor = [UIColor colorWithHex:0xe2e2e2];
    [self.contentView addSubview:self.bottomLine];
    
    /** title */
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = FONT_FOURTEEN;;
    [self.contentView addSubview:self.titleLabel];
    
   
    
    
}

- (void)setlayout {
    self.topLine.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.contentView, 0)
    .widthIs(SCREEN_WIDTH)
    .heightIs(1);
    
    self.numLabel.sd_layout
    .centerXEqualToView(self.contentView)
    .topSpaceToView(self.contentView,0)
    .widthIs(50)
    .heightIs(30);
    
    /** tiitlelabel */
    self.titleLabel.sd_layout
    .rightSpaceToView(self.contentView, 0)
    .topSpaceToView(self.numLabel,0)
    .leftSpaceToView(self.contentView, 0)
    .heightIs(30);
    
    self.bottomLine.sd_layout
    .rightSpaceToView(self.contentView, 0)
    .topSpaceToView(self.titleLabel,0)
    .leftSpaceToView(self.contentView, 0)
    .heightIs(1);
}

@end
